Optimal. Leaf size=175 \[ -\frac {40 d^3 \cos (a+b x)}{9 b^4}+\frac {2 d (c+d x)^2 \cos (a+b x)}{b^2}-\frac {2 d^3 \cos ^3(a+b x)}{27 b^4}+\frac {d (c+d x)^2 \cos ^3(a+b x)}{3 b^2}-\frac {40 d^2 (c+d x) \sin (a+b x)}{9 b^3}+\frac {2 (c+d x)^3 \sin (a+b x)}{3 b}-\frac {2 d^2 (c+d x) \cos ^2(a+b x) \sin (a+b x)}{9 b^3}+\frac {(c+d x)^3 \cos ^2(a+b x) \sin (a+b x)}{3 b} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 175, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 4, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3392, 3377,
2718, 3391} \begin {gather*} -\frac {2 d^3 \cos ^3(a+b x)}{27 b^4}-\frac {40 d^3 \cos (a+b x)}{9 b^4}-\frac {40 d^2 (c+d x) \sin (a+b x)}{9 b^3}-\frac {2 d^2 (c+d x) \sin (a+b x) \cos ^2(a+b x)}{9 b^3}+\frac {d (c+d x)^2 \cos ^3(a+b x)}{3 b^2}+\frac {2 d (c+d x)^2 \cos (a+b x)}{b^2}+\frac {2 (c+d x)^3 \sin (a+b x)}{3 b}+\frac {(c+d x)^3 \sin (a+b x) \cos ^2(a+b x)}{3 b} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2718
Rule 3377
Rule 3391
Rule 3392
Rubi steps
\begin {align*} \int (c+d x)^3 \cos ^3(a+b x) \, dx &=\frac {d (c+d x)^2 \cos ^3(a+b x)}{3 b^2}+\frac {(c+d x)^3 \cos ^2(a+b x) \sin (a+b x)}{3 b}+\frac {2}{3} \int (c+d x)^3 \cos (a+b x) \, dx-\frac {\left (2 d^2\right ) \int (c+d x) \cos ^3(a+b x) \, dx}{3 b^2}\\ &=-\frac {2 d^3 \cos ^3(a+b x)}{27 b^4}+\frac {d (c+d x)^2 \cos ^3(a+b x)}{3 b^2}+\frac {2 (c+d x)^3 \sin (a+b x)}{3 b}-\frac {2 d^2 (c+d x) \cos ^2(a+b x) \sin (a+b x)}{9 b^3}+\frac {(c+d x)^3 \cos ^2(a+b x) \sin (a+b x)}{3 b}-\frac {(2 d) \int (c+d x)^2 \sin (a+b x) \, dx}{b}-\frac {\left (4 d^2\right ) \int (c+d x) \cos (a+b x) \, dx}{9 b^2}\\ &=\frac {2 d (c+d x)^2 \cos (a+b x)}{b^2}-\frac {2 d^3 \cos ^3(a+b x)}{27 b^4}+\frac {d (c+d x)^2 \cos ^3(a+b x)}{3 b^2}-\frac {4 d^2 (c+d x) \sin (a+b x)}{9 b^3}+\frac {2 (c+d x)^3 \sin (a+b x)}{3 b}-\frac {2 d^2 (c+d x) \cos ^2(a+b x) \sin (a+b x)}{9 b^3}+\frac {(c+d x)^3 \cos ^2(a+b x) \sin (a+b x)}{3 b}-\frac {\left (4 d^2\right ) \int (c+d x) \cos (a+b x) \, dx}{b^2}+\frac {\left (4 d^3\right ) \int \sin (a+b x) \, dx}{9 b^3}\\ &=-\frac {4 d^3 \cos (a+b x)}{9 b^4}+\frac {2 d (c+d x)^2 \cos (a+b x)}{b^2}-\frac {2 d^3 \cos ^3(a+b x)}{27 b^4}+\frac {d (c+d x)^2 \cos ^3(a+b x)}{3 b^2}-\frac {40 d^2 (c+d x) \sin (a+b x)}{9 b^3}+\frac {2 (c+d x)^3 \sin (a+b x)}{3 b}-\frac {2 d^2 (c+d x) \cos ^2(a+b x) \sin (a+b x)}{9 b^3}+\frac {(c+d x)^3 \cos ^2(a+b x) \sin (a+b x)}{3 b}+\frac {\left (4 d^3\right ) \int \sin (a+b x) \, dx}{b^3}\\ &=-\frac {40 d^3 \cos (a+b x)}{9 b^4}+\frac {2 d (c+d x)^2 \cos (a+b x)}{b^2}-\frac {2 d^3 \cos ^3(a+b x)}{27 b^4}+\frac {d (c+d x)^2 \cos ^3(a+b x)}{3 b^2}-\frac {40 d^2 (c+d x) \sin (a+b x)}{9 b^3}+\frac {2 (c+d x)^3 \sin (a+b x)}{3 b}-\frac {2 d^2 (c+d x) \cos ^2(a+b x) \sin (a+b x)}{9 b^3}+\frac {(c+d x)^3 \cos ^2(a+b x) \sin (a+b x)}{3 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.61, size = 121, normalized size = 0.69 \begin {gather*} \frac {243 d \left (-2 d^2+b^2 (c+d x)^2\right ) \cos (a+b x)+d \left (-2 d^2+9 b^2 (c+d x)^2\right ) \cos (3 (a+b x))+6 b (c+d x) \left (-82 d^2+15 b^2 (c+d x)^2+\left (-2 d^2+3 b^2 (c+d x)^2\right ) \cos (2 (a+b x))\right ) \sin (a+b x)}{108 b^4} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(559\) vs.
\(2(161)=322\).
time = 0.18, size = 560, normalized size = 3.20 Too large to display
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 535 vs.
\(2 (161) = 322\).
time = 0.32, size = 535, normalized size = 3.06 \begin {gather*} -\frac {36 \, {\left (\sin \left (b x + a\right )^{3} - 3 \, \sin \left (b x + a\right )\right )} c^{3} - \frac {108 \, {\left (\sin \left (b x + a\right )^{3} - 3 \, \sin \left (b x + a\right )\right )} a c^{2} d}{b} + \frac {108 \, {\left (\sin \left (b x + a\right )^{3} - 3 \, \sin \left (b x + a\right )\right )} a^{2} c d^{2}}{b^{2}} - \frac {36 \, {\left (\sin \left (b x + a\right )^{3} - 3 \, \sin \left (b x + a\right )\right )} a^{3} d^{3}}{b^{3}} - \frac {9 \, {\left (3 \, {\left (b x + a\right )} \sin \left (3 \, b x + 3 \, a\right ) + 27 \, {\left (b x + a\right )} \sin \left (b x + a\right ) + \cos \left (3 \, b x + 3 \, a\right ) + 27 \, \cos \left (b x + a\right )\right )} c^{2} d}{b} + \frac {18 \, {\left (3 \, {\left (b x + a\right )} \sin \left (3 \, b x + 3 \, a\right ) + 27 \, {\left (b x + a\right )} \sin \left (b x + a\right ) + \cos \left (3 \, b x + 3 \, a\right ) + 27 \, \cos \left (b x + a\right )\right )} a c d^{2}}{b^{2}} - \frac {9 \, {\left (3 \, {\left (b x + a\right )} \sin \left (3 \, b x + 3 \, a\right ) + 27 \, {\left (b x + a\right )} \sin \left (b x + a\right ) + \cos \left (3 \, b x + 3 \, a\right ) + 27 \, \cos \left (b x + a\right )\right )} a^{2} d^{3}}{b^{3}} - \frac {3 \, {\left (6 \, {\left (b x + a\right )} \cos \left (3 \, b x + 3 \, a\right ) + 162 \, {\left (b x + a\right )} \cos \left (b x + a\right ) + {\left (9 \, {\left (b x + a\right )}^{2} - 2\right )} \sin \left (3 \, b x + 3 \, a\right ) + 81 \, {\left ({\left (b x + a\right )}^{2} - 2\right )} \sin \left (b x + a\right )\right )} c d^{2}}{b^{2}} + \frac {3 \, {\left (6 \, {\left (b x + a\right )} \cos \left (3 \, b x + 3 \, a\right ) + 162 \, {\left (b x + a\right )} \cos \left (b x + a\right ) + {\left (9 \, {\left (b x + a\right )}^{2} - 2\right )} \sin \left (3 \, b x + 3 \, a\right ) + 81 \, {\left ({\left (b x + a\right )}^{2} - 2\right )} \sin \left (b x + a\right )\right )} a d^{3}}{b^{3}} - \frac {{\left ({\left (9 \, {\left (b x + a\right )}^{2} - 2\right )} \cos \left (3 \, b x + 3 \, a\right ) + 243 \, {\left ({\left (b x + a\right )}^{2} - 2\right )} \cos \left (b x + a\right ) + 3 \, {\left (3 \, {\left (b x + a\right )}^{3} - 2 \, b x - 2 \, a\right )} \sin \left (3 \, b x + 3 \, a\right ) + 81 \, {\left ({\left (b x + a\right )}^{3} - 6 \, b x - 6 \, a\right )} \sin \left (b x + a\right )\right )} d^{3}}{b^{3}}}{108 \, b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.38, size = 227, normalized size = 1.30 \begin {gather*} \frac {{\left (9 \, b^{2} d^{3} x^{2} + 18 \, b^{2} c d^{2} x + 9 \, b^{2} c^{2} d - 2 \, d^{3}\right )} \cos \left (b x + a\right )^{3} + 6 \, {\left (9 \, b^{2} d^{3} x^{2} + 18 \, b^{2} c d^{2} x + 9 \, b^{2} c^{2} d - 20 \, d^{3}\right )} \cos \left (b x + a\right ) + 3 \, {\left (6 \, b^{3} d^{3} x^{3} + 18 \, b^{3} c d^{2} x^{2} + 6 \, b^{3} c^{3} - 40 \, b c d^{2} + {\left (3 \, b^{3} d^{3} x^{3} + 9 \, b^{3} c d^{2} x^{2} + 3 \, b^{3} c^{3} - 2 \, b c d^{2} + {\left (9 \, b^{3} c^{2} d - 2 \, b d^{3}\right )} x\right )} \cos \left (b x + a\right )^{2} + 2 \, {\left (9 \, b^{3} c^{2} d - 20 \, b d^{3}\right )} x\right )} \sin \left (b x + a\right )}{27 \, b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 495 vs.
\(2 (173) = 346\).
time = 0.53, size = 495, normalized size = 2.83 \begin {gather*} \begin {cases} \frac {2 c^{3} \sin ^{3}{\left (a + b x \right )}}{3 b} + \frac {c^{3} \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{b} + \frac {2 c^{2} d x \sin ^{3}{\left (a + b x \right )}}{b} + \frac {3 c^{2} d x \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{b} + \frac {2 c d^{2} x^{2} \sin ^{3}{\left (a + b x \right )}}{b} + \frac {3 c d^{2} x^{2} \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{b} + \frac {2 d^{3} x^{3} \sin ^{3}{\left (a + b x \right )}}{3 b} + \frac {d^{3} x^{3} \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{b} + \frac {2 c^{2} d \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{b^{2}} + \frac {7 c^{2} d \cos ^{3}{\left (a + b x \right )}}{3 b^{2}} + \frac {4 c d^{2} x \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{b^{2}} + \frac {14 c d^{2} x \cos ^{3}{\left (a + b x \right )}}{3 b^{2}} + \frac {2 d^{3} x^{2} \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{b^{2}} + \frac {7 d^{3} x^{2} \cos ^{3}{\left (a + b x \right )}}{3 b^{2}} - \frac {40 c d^{2} \sin ^{3}{\left (a + b x \right )}}{9 b^{3}} - \frac {14 c d^{2} \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{3 b^{3}} - \frac {40 d^{3} x \sin ^{3}{\left (a + b x \right )}}{9 b^{3}} - \frac {14 d^{3} x \sin {\left (a + b x \right )} \cos ^{2}{\left (a + b x \right )}}{3 b^{3}} - \frac {40 d^{3} \sin ^{2}{\left (a + b x \right )} \cos {\left (a + b x \right )}}{9 b^{4}} - \frac {122 d^{3} \cos ^{3}{\left (a + b x \right )}}{27 b^{4}} & \text {for}\: b \neq 0 \\\left (c^{3} x + \frac {3 c^{2} d x^{2}}{2} + c d^{2} x^{3} + \frac {d^{3} x^{4}}{4}\right ) \cos ^{3}{\left (a \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.48, size = 231, normalized size = 1.32 \begin {gather*} \frac {{\left (9 \, b^{2} d^{3} x^{2} + 18 \, b^{2} c d^{2} x + 9 \, b^{2} c^{2} d - 2 \, d^{3}\right )} \cos \left (3 \, b x + 3 \, a\right )}{108 \, b^{4}} + \frac {9 \, {\left (b^{2} d^{3} x^{2} + 2 \, b^{2} c d^{2} x + b^{2} c^{2} d - 2 \, d^{3}\right )} \cos \left (b x + a\right )}{4 \, b^{4}} + \frac {{\left (3 \, b^{3} d^{3} x^{3} + 9 \, b^{3} c d^{2} x^{2} + 9 \, b^{3} c^{2} d x + 3 \, b^{3} c^{3} - 2 \, b d^{3} x - 2 \, b c d^{2}\right )} \sin \left (3 \, b x + 3 \, a\right )}{36 \, b^{4}} + \frac {3 \, {\left (b^{3} d^{3} x^{3} + 3 \, b^{3} c d^{2} x^{2} + 3 \, b^{3} c^{2} d x + b^{3} c^{3} - 6 \, b d^{3} x - 6 \, b c d^{2}\right )} \sin \left (b x + a\right )}{4 \, b^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.72, size = 364, normalized size = 2.08 \begin {gather*} \frac {7\,d^3\,x^2\,{\cos \left (a+b\,x\right )}^3}{3\,b^2}-\frac {2\,{\sin \left (a+b\,x\right )}^3\,\left (20\,c\,d^2-3\,b^2\,c^3\right )}{9\,b^3}-\frac {{\cos \left (a+b\,x\right )}^2\,\sin \left (a+b\,x\right )\,\left (14\,c\,d^2-3\,b^2\,c^3\right )}{3\,b^3}-\frac {2\,\cos \left (a+b\,x\right )\,{\sin \left (a+b\,x\right )}^2\,\left (20\,d^3-9\,b^2\,c^2\,d\right )}{9\,b^4}-\frac {2\,x\,{\sin \left (a+b\,x\right )}^3\,\left (20\,d^3-9\,b^2\,c^2\,d\right )}{9\,b^3}-\frac {{\cos \left (a+b\,x\right )}^3\,\left (122\,d^3-63\,b^2\,c^2\,d\right )}{27\,b^4}+\frac {2\,d^3\,x^3\,{\sin \left (a+b\,x\right )}^3}{3\,b}+\frac {14\,c\,d^2\,x\,{\cos \left (a+b\,x\right )}^3}{3\,b^2}-\frac {x\,{\cos \left (a+b\,x\right )}^2\,\sin \left (a+b\,x\right )\,\left (14\,d^3-9\,b^2\,c^2\,d\right )}{3\,b^3}+\frac {d^3\,x^3\,{\cos \left (a+b\,x\right )}^2\,\sin \left (a+b\,x\right )}{b}+\frac {2\,d^3\,x^2\,\cos \left (a+b\,x\right )\,{\sin \left (a+b\,x\right )}^2}{b^2}+\frac {2\,c\,d^2\,x^2\,{\sin \left (a+b\,x\right )}^3}{b}+\frac {3\,c\,d^2\,x^2\,{\cos \left (a+b\,x\right )}^2\,\sin \left (a+b\,x\right )}{b}+\frac {4\,c\,d^2\,x\,\cos \left (a+b\,x\right )\,{\sin \left (a+b\,x\right )}^2}{b^2} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________